package zli.prototype;

import java.io.Serializable;

/**
 * @author ZerlindaLi create at 2021/3/23 15:38
 * @version 1.0.0
 * @description 浅克隆实现Cloneable即可
 */
public class Father implements Cloneable, Serializable {
    private String character;
    private String looks;

    public String getCharacter() {
        return character;
    }

    public void setCharacter(String character) {
        this.character = character;
    }

    public String getLooks() {
        return looks;
    }

    public void setLooks(String looks) {
        this.looks = looks;
    }

    @Override
    public String toString() {
        return "Father{" +
                "character='" + character + '\'' +
                ", looks='" + looks + '\'' +
                '}';
    }

    public Father clone(){
        try {
            return (Father)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }
}
